/*
* Copyright (c) 2022-2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. 
* Licensed under the Apache License, Version 2.0 (the "License"); 
* you may not use this file except in compliance with the License. 
* You may obtain a copy of the License at 
*
* http://www.apache.org/licenses/LICENSE-2.0 
*
* Unless required by applicable law or agreed to in writing, software 
* distributed under the License is distributed on an "AS IS" BASIS, 
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
* See the License for the specific language governing permissions and 
* limitations under the License. 
*/

var base3d_vs = `
attribute vec3 position;

uniform mat4 uMat;
uniform mat4 tMat;
uniform vec4 uColor;

varying vec4 vColor;
void main()
{
    gl_Position=vec4(position.x, position.y, position.z, 1.0)*tMat*uMat;

    // vec3 transformedNormal = normalize(gl_Position.xyz);
    // vec3 lightDir = normalize(vec3(1.0, 1.0, -1.0));
    // float diff = dot(lightDir, transformedNormal) / 2.0 + 0.8;
    // vColor = uColor * vec4(diff, diff, diff, 1.0);

    vColor = uColor;
}
`

var base3d_fs = `
precision mediump float;

varying vec4 vColor;

void main()
{
    gl_FragColor = vColor;
}`

module.exports = {
    base3d_vs,
    base3d_fs
}